from logging import debug
from app import app
from dash import Input, Output, html, dcc
import dash_bootstrap_components as dbc
import apps.appAnalysis
import apps.appDown


app.layout = html.Div(
    [dbc.Container(
        [dcc.Link('下载数据|', href='/apps/appDown', style={"display": "line-block", }),
         dcc.Link('数据分析', href='/apps/appAnalysis')], className='flex-row'),
     dcc.Location(id='url', refresh=False,),
     html.Div(id='page-content', children=[],)]
)


@app.callback(Output('page-content', 'children'),
              Input(component_id='url', component_property='pathname'))
def display_page(pathname):
    if pathname == '/apps/appDown':
        return apps.appDown.layout
    else:
        return '404'


if __name__ == "__main__":
    app.run_server(debug=True)
